<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>相对定位</title>
    <style>
      .outer {
        width: 500px;
        background-color: skyblue;
        border: 1px solid black;
        padding: 20px;
      }

      .box {
        width: 100px;
        height: 100px;
      }

      .box1 {
        background-color: #999;
      }

      .box2 {
        background-color: orange;
        /* 相对于发生定位之前的位置。，也就是相对于自己原来的位置 */
        position: relative;
        top: 20px;
        left: 30px;
      }

      .box3 {
        background-color: green;
        /* position: relative; */
        /* z-index: 2px; */
      }
    </style>
  </head>
  <body>
    <div class="outer">
      <div class="box box1">1</div>
      <div class="box box2">2</div>
      <div class="box box3">3</div>
    </div>
  </body>
</html>
